package test;
import contant.Ball;
import contant.Cylinder;
import contant.Cuboid;
import java.util.Scanner;

public class Demo {
	public static void main(String[] args) {
		Scanner all=new Scanner(System.in);
		System.out.println("请选择物体的形状（球，圆柱，长方体）：");
		String shape=all.next();
		switch (shape) {
		case "球":
			System.out.println("请输入球的半径：");
			Ball ba=new Ball(contant.Ball.r=all.nextDouble());
		
	
			
			System.out.println("球的体积为："+ba.reachVolume());
			break;
		case "圆柱":
			System.out.println("请输入圆柱的底面半径及高:");
			Cylinder cy=new Cylinder(contant.Cylinder.r=all.nextDouble(), contant.Cylinder.h=all.nextDouble());
			System.out.println("圆柱的体积为："+cy.reachVolume());
			break;
		case "长方体":
			System.out.println("请输入依次长方体的长宽高:");
			Cuboid cu=new Cuboid(contant.Cuboid.l=all.nextDouble(),contant.Cuboid.w=all.nextDouble(),contant.Cuboid.h=all.nextDouble());
			
			System.out.println("长方体的体积为："+cu.reachVolume());
			
			break;
			
		

		default:
			System.out.println("暂不支持计算此类型，请选择其他类型。");
			break;
		}
		
	
		
	}

	

}
